import {axios,axiosFile} from '@u/request'

// 得到任务页的产品初始列表
const getProductList = (params = {}) => axios.post('/back/task', params)

// 获取新增子组件产品名称
const getAddProduct = () => axios.get('/back/task/getProduct')

// 获取详情
const getProductDetail = (id:any)=> axios.get('/back/task/product/'+id)

// 获取时间
const getTimeInfo = ()=> axios.get('/back/task/getSendSet')

// 提交任务信息
const submitInfo = (params = {})=> axios.post('/back/task/save', params)

// 获取详情信息
const getDetailInfo = (id:any)=> axios.get('/back/task/'+id)

// 删除任务信息
const delInfo = (id:any)=> axios.delete('/back/task/'+id)

//启动和暂停操作
const switchOption =  (id:any, params = {})=> axios.put('/back/task/updateStatus/'+id, null,{ params })

//导出
export const exportTask = (data:any) => axiosFile({
  method: 'post',
  data,
  url: `/back/task/export`
})         
export { getProductList,getAddProduct,getProductDetail, getTimeInfo,submitInfo, getDetailInfo,delInfo,switchOption,}
